package u.can.i.up.utils;

import java.util.ArrayList;
import java.util.List;

import u.can.i.up.db.mysql.SourceInfo;
import u.can.i.up.db.postgre.AppInfo;

public class SourceInfoUtil {

	public static List<SourceInfo> removeExistingSource(List<SourceInfo> sourceInfoList,
			List<AppInfo> existingAppInfoList) {
		List<SourceInfo> returnSourceInfoList = new ArrayList<SourceInfo>();
		for (SourceInfo si : sourceInfoList) {
			boolean flag = false;
			for (AppInfo ai : existingAppInfoList) {
				if (si.getMd5().equals(ai.getMd5())) {
					flag = true;
					break;
				}
			}
			if (!flag)
				returnSourceInfoList.add(si);
		}
		return returnSourceInfoList;
	}
}
